/**
 * This is a generated class and is not intended for modification.  To customize behavior
 * of this value object you may modify the generated sub-class of this class - VoCompanyMaster.as.
 */

package com.model.valueObjects
{
import com.adobe.fiber.services.IFiberManagingService;
import com.adobe.fiber.util.FiberUtils;
import com.adobe.fiber.valueobjects.IValueObject;
import flash.events.Event;
import flash.events.EventDispatcher;
import mx.binding.utils.ChangeWatcher;
import mx.events.PropertyChangeEvent;
import mx.validators.ValidationResult;

import flash.net.registerClassAlias;
import flash.net.getClassByAlias;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;

use namespace model_internal;

[ExcludeClass]
public class _Super_VoCompanyMaster extends flash.events.EventDispatcher implements com.adobe.fiber.valueobjects.IValueObject
{
    model_internal static function initRemoteClassAliasSingle(cz:Class) : void
    {
        try
        {
            if (flash.net.getClassByAlias("VoCompanyMaster") == null)
            {
                flash.net.registerClassAlias("VoCompanyMaster", cz);
            }
        }
        catch (e:Error)
        {
            flash.net.registerClassAlias("VoCompanyMaster", cz);
        }
    }

    model_internal static function initRemoteClassAliasAllRelated() : void
    {
    }

    model_internal var _dminternal_model : _VoCompanyMasterEntityMetadata;

    /**
     * properties
     */
    private var _internal_cre_datetime : String;
    private var _internal_company_email : String;
    private var _internal_serialnumber : int;
    private var _internal_company_address1 : String;
    private var _internal_country_name : String;
    private var _internal_company_city : String;
    private var _internal_company_fax : String;
    private var _internal_cre_userid : int;
    private var _internal_company_url : String;
    private var _internal_country_serialnumber_fk : int;
    private var _internal_gst_code : String;
    private var _internal_company_name : String;
    private var _internal_state_serialnumber_fk : int;
    private var _internal_company_address2 : String;
    private var _internal_company_regno1 : String;
    private var _internal_company_phone : String;
    private var _internal_activestatus : String;
    private var _internal_company_zip : String;

    private static var emptyArray:Array = new Array();


    /**
     * derived property cache initialization
     */
    model_internal var _cacheInitialized_isValid:Boolean = false;

    model_internal var _changeWatcherArray:Array = new Array();

    public function _Super_VoCompanyMaster()
    {
        _model = new _VoCompanyMasterEntityMetadata(this);

        // Bind to own data properties for cache invalidation triggering
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "cre_datetime", model_internal::setterListenerCre_datetime));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "company_email", model_internal::setterListenerCompany_email));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "company_address1", model_internal::setterListenerCompany_address1));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "country_name", model_internal::setterListenerCountry_name));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "company_city", model_internal::setterListenerCompany_city));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "company_fax", model_internal::setterListenerCompany_fax));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "company_url", model_internal::setterListenerCompany_url));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "gst_code", model_internal::setterListenerGst_code));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "company_name", model_internal::setterListenerCompany_name));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "company_address2", model_internal::setterListenerCompany_address2));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "company_regno1", model_internal::setterListenerCompany_regno1));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "company_phone", model_internal::setterListenerCompany_phone));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "activestatus", model_internal::setterListenerActivestatus));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "company_zip", model_internal::setterListenerCompany_zip));

    }

    /**
     * data property getters
     */

    [Bindable(event="propertyChange")]
    public function get cre_datetime() : String
    {
        return _internal_cre_datetime;
    }

    [Bindable(event="propertyChange")]
    public function get company_email() : String
    {
        return _internal_company_email;
    }

    [Bindable(event="propertyChange")]
    public function get serialnumber() : int
    {
        return _internal_serialnumber;
    }

    [Bindable(event="propertyChange")]
    public function get company_address1() : String
    {
        return _internal_company_address1;
    }

    [Bindable(event="propertyChange")]
    public function get country_name() : String
    {
        return _internal_country_name;
    }

    [Bindable(event="propertyChange")]
    public function get company_city() : String
    {
        return _internal_company_city;
    }

    [Bindable(event="propertyChange")]
    public function get company_fax() : String
    {
        return _internal_company_fax;
    }

    [Bindable(event="propertyChange")]
    public function get cre_userid() : int
    {
        return _internal_cre_userid;
    }

    [Bindable(event="propertyChange")]
    public function get company_url() : String
    {
        return _internal_company_url;
    }

    [Bindable(event="propertyChange")]
    public function get country_serialnumber_fk() : int
    {
        return _internal_country_serialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get gst_code() : String
    {
        return _internal_gst_code;
    }

    [Bindable(event="propertyChange")]
    public function get company_name() : String
    {
        return _internal_company_name;
    }

    [Bindable(event="propertyChange")]
    public function get state_serialnumber_fk() : int
    {
        return _internal_state_serialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get company_address2() : String
    {
        return _internal_company_address2;
    }

    [Bindable(event="propertyChange")]
    public function get company_regno1() : String
    {
        return _internal_company_regno1;
    }

    [Bindable(event="propertyChange")]
    public function get company_phone() : String
    {
        return _internal_company_phone;
    }

    [Bindable(event="propertyChange")]
    public function get activestatus() : String
    {
        return _internal_activestatus;
    }

    [Bindable(event="propertyChange")]
    public function get company_zip() : String
    {
        return _internal_company_zip;
    }

    /**
     * data property setters
     */

    public function set cre_datetime(value:String) : void
    {
        var oldValue:String = _internal_cre_datetime;
        if (oldValue !== value)
        {
            _internal_cre_datetime = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "cre_datetime", oldValue, _internal_cre_datetime));
        }
    }

    public function set company_email(value:String) : void
    {
        var oldValue:String = _internal_company_email;
        if (oldValue !== value)
        {
            _internal_company_email = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_email", oldValue, _internal_company_email));
        }
    }

    public function set serialnumber(value:int) : void
    {
        var oldValue:int = _internal_serialnumber;
        if (oldValue !== value)
        {
            _internal_serialnumber = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "serialnumber", oldValue, _internal_serialnumber));
        }
    }

    public function set company_address1(value:String) : void
    {
        var oldValue:String = _internal_company_address1;
        if (oldValue !== value)
        {
            _internal_company_address1 = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_address1", oldValue, _internal_company_address1));
        }
    }

    public function set country_name(value:String) : void
    {
        var oldValue:String = _internal_country_name;
        if (oldValue !== value)
        {
            _internal_country_name = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "country_name", oldValue, _internal_country_name));
        }
    }

    public function set company_city(value:String) : void
    {
        var oldValue:String = _internal_company_city;
        if (oldValue !== value)
        {
            _internal_company_city = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_city", oldValue, _internal_company_city));
        }
    }

    public function set company_fax(value:String) : void
    {
        var oldValue:String = _internal_company_fax;
        if (oldValue !== value)
        {
            _internal_company_fax = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_fax", oldValue, _internal_company_fax));
        }
    }

    public function set cre_userid(value:int) : void
    {
        var oldValue:int = _internal_cre_userid;
        if (oldValue !== value)
        {
            _internal_cre_userid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "cre_userid", oldValue, _internal_cre_userid));
        }
    }

    public function set company_url(value:String) : void
    {
        var oldValue:String = _internal_company_url;
        if (oldValue !== value)
        {
            _internal_company_url = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_url", oldValue, _internal_company_url));
        }
    }

    public function set country_serialnumber_fk(value:int) : void
    {
        var oldValue:int = _internal_country_serialnumber_fk;
        if (oldValue !== value)
        {
            _internal_country_serialnumber_fk = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "country_serialnumber_fk", oldValue, _internal_country_serialnumber_fk));
        }
    }

    public function set gst_code(value:String) : void
    {
        var oldValue:String = _internal_gst_code;
        if (oldValue !== value)
        {
            _internal_gst_code = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "gst_code", oldValue, _internal_gst_code));
        }
    }

    public function set company_name(value:String) : void
    {
        var oldValue:String = _internal_company_name;
        if (oldValue !== value)
        {
            _internal_company_name = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_name", oldValue, _internal_company_name));
        }
    }

    public function set state_serialnumber_fk(value:int) : void
    {
        var oldValue:int = _internal_state_serialnumber_fk;
        if (oldValue !== value)
        {
            _internal_state_serialnumber_fk = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "state_serialnumber_fk", oldValue, _internal_state_serialnumber_fk));
        }
    }

    public function set company_address2(value:String) : void
    {
        var oldValue:String = _internal_company_address2;
        if (oldValue !== value)
        {
            _internal_company_address2 = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_address2", oldValue, _internal_company_address2));
        }
    }

    public function set company_regno1(value:String) : void
    {
        var oldValue:String = _internal_company_regno1;
        if (oldValue !== value)
        {
            _internal_company_regno1 = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_regno1", oldValue, _internal_company_regno1));
        }
    }

    public function set company_phone(value:String) : void
    {
        var oldValue:String = _internal_company_phone;
        if (oldValue !== value)
        {
            _internal_company_phone = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_phone", oldValue, _internal_company_phone));
        }
    }

    public function set activestatus(value:String) : void
    {
        var oldValue:String = _internal_activestatus;
        if (oldValue !== value)
        {
            _internal_activestatus = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "activestatus", oldValue, _internal_activestatus));
        }
    }

    public function set company_zip(value:String) : void
    {
        var oldValue:String = _internal_company_zip;
        if (oldValue !== value)
        {
            _internal_company_zip = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "company_zip", oldValue, _internal_company_zip));
        }
    }

    /**
     * Data property setter listeners
     *
     * Each data property whose value affects other properties or the validity of the entity
     * needs to invalidate all previously calculated artifacts. These include:
     *  - any derived properties or constraints that reference the given data property.
     *  - any availability guards (variant expressions) that reference the given data property.
     *  - any style validations, message tokens or guards that reference the given data property.
     *  - the validity of the property (and the containing entity) if the given data property has a length restriction.
     *  - the validity of the property (and the containing entity) if the given data property is required.
     */

    model_internal function setterListenerCre_datetime(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCre_datetime();
    }

    model_internal function setterListenerCompany_email(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCompany_email();
    }

    model_internal function setterListenerCompany_address1(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCompany_address1();
    }

    model_internal function setterListenerCountry_name(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCountry_name();
    }

    model_internal function setterListenerCompany_city(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCompany_city();
    }

    model_internal function setterListenerCompany_fax(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCompany_fax();
    }

    model_internal function setterListenerCompany_url(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCompany_url();
    }

    model_internal function setterListenerGst_code(value:flash.events.Event):void
    {
        _model.invalidateDependentOnGst_code();
    }

    model_internal function setterListenerCompany_name(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCompany_name();
    }

    model_internal function setterListenerCompany_address2(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCompany_address2();
    }

    model_internal function setterListenerCompany_regno1(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCompany_regno1();
    }

    model_internal function setterListenerCompany_phone(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCompany_phone();
    }

    model_internal function setterListenerActivestatus(value:flash.events.Event):void
    {
        _model.invalidateDependentOnActivestatus();
    }

    model_internal function setterListenerCompany_zip(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCompany_zip();
    }


    /**
     * valid related derived properties
     */
    model_internal var _isValid : Boolean;
    model_internal var _invalidConstraints:Array = new Array();
    model_internal var _validationFailureMessages:Array = new Array();

    /**
     * derived property calculators
     */

    /**
     * isValid calculator
     */
    model_internal function calculateIsValid():Boolean
    {
        var violatedConsts:Array = new Array();
        var validationFailureMessages:Array = new Array();

        var propertyValidity:Boolean = true;
        if (!_model.cre_datetimeIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_cre_datetimeValidationFailureMessages);
        }
        if (!_model.company_emailIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_company_emailValidationFailureMessages);
        }
        if (!_model.company_address1IsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_company_address1ValidationFailureMessages);
        }
        if (!_model.country_nameIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_country_nameValidationFailureMessages);
        }
        if (!_model.company_cityIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_company_cityValidationFailureMessages);
        }
        if (!_model.company_faxIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_company_faxValidationFailureMessages);
        }
        if (!_model.company_urlIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_company_urlValidationFailureMessages);
        }
        if (!_model.gst_codeIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_gst_codeValidationFailureMessages);
        }
        if (!_model.company_nameIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_company_nameValidationFailureMessages);
        }
        if (!_model.company_address2IsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_company_address2ValidationFailureMessages);
        }
        if (!_model.company_regno1IsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_company_regno1ValidationFailureMessages);
        }
        if (!_model.company_phoneIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_company_phoneValidationFailureMessages);
        }
        if (!_model.activestatusIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_activestatusValidationFailureMessages);
        }
        if (!_model.company_zipIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_company_zipValidationFailureMessages);
        }

        model_internal::_cacheInitialized_isValid = true;
        model_internal::invalidConstraints_der = violatedConsts;
        model_internal::validationFailureMessages_der = validationFailureMessages;
        return violatedConsts.length == 0 && propertyValidity;
    }

    /**
     * derived property setters
     */

    model_internal function set isValid_der(value:Boolean) : void
    {
        var oldValue:Boolean = model_internal::_isValid;
        if (oldValue !== value)
        {
            model_internal::_isValid = value;
            _model.model_internal::fireChangeEvent("isValid", oldValue, model_internal::_isValid);
        }
    }

    /**
     * derived property getters
     */

    [Transient]
    [Bindable(event="propertyChange")]
    public function get _model() : _VoCompanyMasterEntityMetadata
    {
        return model_internal::_dminternal_model;
    }

    public function set _model(value : _VoCompanyMasterEntityMetadata) : void
    {
        var oldValue : _VoCompanyMasterEntityMetadata = model_internal::_dminternal_model;
        if (oldValue !== value)
        {
            model_internal::_dminternal_model = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "_model", oldValue, model_internal::_dminternal_model));
        }
    }

    /**
     * methods
     */


    /**
     *  services
     */
    private var _managingService:com.adobe.fiber.services.IFiberManagingService;

    public function set managingService(managingService:com.adobe.fiber.services.IFiberManagingService):void
    {
        _managingService = managingService;
    }

    model_internal function set invalidConstraints_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_invalidConstraints;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_invalidConstraints = value;
            _model.model_internal::fireChangeEvent("invalidConstraints", oldValue, model_internal::_invalidConstraints);
        }
    }

    model_internal function set validationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_validationFailureMessages;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_validationFailureMessages = value;
            _model.model_internal::fireChangeEvent("validationFailureMessages", oldValue, model_internal::_validationFailureMessages);
        }
    }

    model_internal var _doValidationCacheOfCre_datetime : Array = null;
    model_internal var _doValidationLastValOfCre_datetime : String;

    model_internal function _doValidationForCre_datetime(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCre_datetime != null && model_internal::_doValidationLastValOfCre_datetime == value)
           return model_internal::_doValidationCacheOfCre_datetime ;

        _model.model_internal::_cre_datetimeIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCre_datetimeAvailable && _internal_cre_datetime == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "cre_datetime is required"));
        }

        model_internal::_doValidationCacheOfCre_datetime = validationFailures;
        model_internal::_doValidationLastValOfCre_datetime = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCompany_email : Array = null;
    model_internal var _doValidationLastValOfCompany_email : String;

    model_internal function _doValidationForCompany_email(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCompany_email != null && model_internal::_doValidationLastValOfCompany_email == value)
           return model_internal::_doValidationCacheOfCompany_email ;

        _model.model_internal::_company_emailIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCompany_emailAvailable && _internal_company_email == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "company_email is required"));
        }

        model_internal::_doValidationCacheOfCompany_email = validationFailures;
        model_internal::_doValidationLastValOfCompany_email = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCompany_address1 : Array = null;
    model_internal var _doValidationLastValOfCompany_address1 : String;

    model_internal function _doValidationForCompany_address1(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCompany_address1 != null && model_internal::_doValidationLastValOfCompany_address1 == value)
           return model_internal::_doValidationCacheOfCompany_address1 ;

        _model.model_internal::_company_address1IsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCompany_address1Available && _internal_company_address1 == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "company_address1 is required"));
        }

        model_internal::_doValidationCacheOfCompany_address1 = validationFailures;
        model_internal::_doValidationLastValOfCompany_address1 = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCountry_name : Array = null;
    model_internal var _doValidationLastValOfCountry_name : String;

    model_internal function _doValidationForCountry_name(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCountry_name != null && model_internal::_doValidationLastValOfCountry_name == value)
           return model_internal::_doValidationCacheOfCountry_name ;

        _model.model_internal::_country_nameIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCountry_nameAvailable && _internal_country_name == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "country_name is required"));
        }

        model_internal::_doValidationCacheOfCountry_name = validationFailures;
        model_internal::_doValidationLastValOfCountry_name = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCompany_city : Array = null;
    model_internal var _doValidationLastValOfCompany_city : String;

    model_internal function _doValidationForCompany_city(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCompany_city != null && model_internal::_doValidationLastValOfCompany_city == value)
           return model_internal::_doValidationCacheOfCompany_city ;

        _model.model_internal::_company_cityIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCompany_cityAvailable && _internal_company_city == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "company_city is required"));
        }

        model_internal::_doValidationCacheOfCompany_city = validationFailures;
        model_internal::_doValidationLastValOfCompany_city = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCompany_fax : Array = null;
    model_internal var _doValidationLastValOfCompany_fax : String;

    model_internal function _doValidationForCompany_fax(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCompany_fax != null && model_internal::_doValidationLastValOfCompany_fax == value)
           return model_internal::_doValidationCacheOfCompany_fax ;

        _model.model_internal::_company_faxIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCompany_faxAvailable && _internal_company_fax == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "company_fax is required"));
        }

        model_internal::_doValidationCacheOfCompany_fax = validationFailures;
        model_internal::_doValidationLastValOfCompany_fax = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCompany_url : Array = null;
    model_internal var _doValidationLastValOfCompany_url : String;

    model_internal function _doValidationForCompany_url(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCompany_url != null && model_internal::_doValidationLastValOfCompany_url == value)
           return model_internal::_doValidationCacheOfCompany_url ;

        _model.model_internal::_company_urlIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCompany_urlAvailable && _internal_company_url == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "company_url is required"));
        }

        model_internal::_doValidationCacheOfCompany_url = validationFailures;
        model_internal::_doValidationLastValOfCompany_url = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfGst_code : Array = null;
    model_internal var _doValidationLastValOfGst_code : String;

    model_internal function _doValidationForGst_code(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfGst_code != null && model_internal::_doValidationLastValOfGst_code == value)
           return model_internal::_doValidationCacheOfGst_code ;

        _model.model_internal::_gst_codeIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isGst_codeAvailable && _internal_gst_code == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "gst_code is required"));
        }

        model_internal::_doValidationCacheOfGst_code = validationFailures;
        model_internal::_doValidationLastValOfGst_code = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCompany_name : Array = null;
    model_internal var _doValidationLastValOfCompany_name : String;

    model_internal function _doValidationForCompany_name(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCompany_name != null && model_internal::_doValidationLastValOfCompany_name == value)
           return model_internal::_doValidationCacheOfCompany_name ;

        _model.model_internal::_company_nameIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCompany_nameAvailable && _internal_company_name == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "company_name is required"));
        }

        model_internal::_doValidationCacheOfCompany_name = validationFailures;
        model_internal::_doValidationLastValOfCompany_name = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCompany_address2 : Array = null;
    model_internal var _doValidationLastValOfCompany_address2 : String;

    model_internal function _doValidationForCompany_address2(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCompany_address2 != null && model_internal::_doValidationLastValOfCompany_address2 == value)
           return model_internal::_doValidationCacheOfCompany_address2 ;

        _model.model_internal::_company_address2IsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCompany_address2Available && _internal_company_address2 == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "company_address2 is required"));
        }

        model_internal::_doValidationCacheOfCompany_address2 = validationFailures;
        model_internal::_doValidationLastValOfCompany_address2 = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCompany_regno1 : Array = null;
    model_internal var _doValidationLastValOfCompany_regno1 : String;

    model_internal function _doValidationForCompany_regno1(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCompany_regno1 != null && model_internal::_doValidationLastValOfCompany_regno1 == value)
           return model_internal::_doValidationCacheOfCompany_regno1 ;

        _model.model_internal::_company_regno1IsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCompany_regno1Available && _internal_company_regno1 == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "company_regno1 is required"));
        }

        model_internal::_doValidationCacheOfCompany_regno1 = validationFailures;
        model_internal::_doValidationLastValOfCompany_regno1 = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCompany_phone : Array = null;
    model_internal var _doValidationLastValOfCompany_phone : String;

    model_internal function _doValidationForCompany_phone(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCompany_phone != null && model_internal::_doValidationLastValOfCompany_phone == value)
           return model_internal::_doValidationCacheOfCompany_phone ;

        _model.model_internal::_company_phoneIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCompany_phoneAvailable && _internal_company_phone == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "company_phone is required"));
        }

        model_internal::_doValidationCacheOfCompany_phone = validationFailures;
        model_internal::_doValidationLastValOfCompany_phone = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfActivestatus : Array = null;
    model_internal var _doValidationLastValOfActivestatus : String;

    model_internal function _doValidationForActivestatus(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfActivestatus != null && model_internal::_doValidationLastValOfActivestatus == value)
           return model_internal::_doValidationCacheOfActivestatus ;

        _model.model_internal::_activestatusIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isActivestatusAvailable && _internal_activestatus == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "activestatus is required"));
        }

        model_internal::_doValidationCacheOfActivestatus = validationFailures;
        model_internal::_doValidationLastValOfActivestatus = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCompany_zip : Array = null;
    model_internal var _doValidationLastValOfCompany_zip : String;

    model_internal function _doValidationForCompany_zip(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCompany_zip != null && model_internal::_doValidationLastValOfCompany_zip == value)
           return model_internal::_doValidationCacheOfCompany_zip ;

        _model.model_internal::_company_zipIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCompany_zipAvailable && _internal_company_zip == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "company_zip is required"));
        }

        model_internal::_doValidationCacheOfCompany_zip = validationFailures;
        model_internal::_doValidationLastValOfCompany_zip = value;

        return validationFailures;
    }
    

}

}
